<?php
/**[内容视图模型]
 * @Author: 976123967@qq.com
 * @Date:   2014-08-15 18:14:52
 * @Last Modified by:   chenli
 * @Last Modified time: 2015-03-05 23:44:27
 */

class FlagViewModel extends ViewModel{

	public $tableName='article';

	public $viewFields  = array(
		'article'=>array(
			'*',
			'_type'=>'INNER',
		),
		'user'=>array(
			'username','uid',
			'_type'=>'INNER',
			'_on' =>'user.uid=article.user_uid',
		),
		'category'=>array(
			'cid','cname','remark',
			'_type'=>'INNER',
			'_on' =>'category.cid=article.category_cid',
		)
	);


	

	/**
	 * [find_one 查找符合条件的一条记录]
	 * @param  [type] $where [description]
	 * @param  [type] $order [description]
	 * @param  [type] $field [description]
	 * @return [type]        [description]
	 */
	public function find_one($where,$order,$field)
	{
		return $this->field($field)->where($where)->order($order)->find();
	}

	
}